<?php
namespace Wanhu\Controller;
use Think\Controller;
class DataController extends Controller {
    public function getdata(){
        $cycle = 24;
        $interval = 3600;
        for($i=0;$i<$cycle;i++){
            $time = 1458489600;
            $timeList[] = $time+($interval*$i);
        }
        $sleepingModel = M('Sleeping');
        $guessModel = M('Sleeping');
        foreach($timeList as $time){
            $where = [
                'create_time'=>['lt', $time];
            ];
            echo $sleepingModel->where($where)->count();
            echo ',';
            $where = [
                'prize_time'=>['lt', $time];
            ];
            echo $sleepingModel->where($where)->count();
            echo ',';
            $where = [
                'create_time'=>['lt', $time];
            ];
            echo $guessModel->where($where)->count();
            echo ',';
        }
    }
}
